package com.funtester.seven.day2;

public class ToO {

    public static void main(String[] args) {
//        print(toStr(100));
        Var.print2(plus(3, 2.6, true));
        print(plus(3, 2.6, false));
        plus(1, 2.2);//按照参数类型的顺序匹配响应的方法
//        print(1,2,);
        String a = "123";
        String b = "123";
        String c = new String("123");
        print(a == b);//true
        print(a == c);//false
        print("123" == "123");//true
        print(a.equals(c));//false
        String s = new String();

    }

    //第一种思路
    public static int plus(double a, int b) {
        double v = b * 1.0 * a;
        return (int) v;
    }

    //第二种思路
    public static int plus(int b, double a) {
        int aa = (int) a;
        return aa * b;
    }

    //key= true,第一种思路,key=false,第二种思路
    public static int plus(int b, double a, boolean key) {
        if (key) {
            return plus(a, b);
        } else {
            return plus(b, a);
        }
    }

    public static void print(String str) {
        System.out.println(str);
    }
    public static void print(boolean str) {
        System.out.println(str);
    }
    public static void print(int num) {
        System.out.println(toStr(num));
    }

    public static String toStr(int i) {
//        i = i + 100;
        return i + "";
    }

    //实现两个int类型的加减乘除

}
